﻿@page

@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageSearchBox
@using Volo.CmsKit.Admin.Web.Pages.CmsKit.BlogPosts
@using Volo.CmsKit.Admin.Web.Pages
@using Volo.CmsKit.Admin.Web.Menus
@using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar
@using Volo.CmsKit.Blogs

@inherits CmsKitAdminPageBase

@model IndexModel

@{
    PageLayout.Content.Title = L["BlogPosts"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:CMS"].Value);
    PageLayout.Content.MenuItemName = CmsKitAdminMenus.BlogPosts.BlogPostsMenu;
}

@section scripts {
    <abp-script src="/client-proxies/cms-kit-common-proxy.js"/>
    <abp-script src="/client-proxies/cms-kit-admin-proxy.js"/>
    <abp-script src="/Pages/CmsKit/BlogPosts/index.js"/>
}


@section content_toolbar {
    @await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new {pageName = typeof(IndexModel).FullName})
}

<div class="alert alert-warning" style="display: none" role="alert" id="alertHasBlogPostWaitingForReview">
    <abp-button button-type="Link" type="button" text="@L["HasBlogPostWaitingForReviewMessage"].Value" id="button-show-waiting-for-review"/>
</div>

<abp-card class="mb-4">
    <abp-card-body>
        <div id="CmsKitBlogPostsWrapper">
            <abp-row>
                <abp-column size="_2">
                    <select id="StatusSelect" class="form-select">
                        <option value="">@L["SelectAStatus"]</option>
                        @foreach (var status in (BlogPostStatus[]) Enum.GetValues(typeof(BlogPostStatus)))
                        {
                            <option value="@((int)status)">@L["CmsKit.BlogPost.Status." + (int)status]</option>
                        }
                    </select>
                </abp-column>
                <abp-column size="_10">
                    @await Component.InvokeAsync(typeof(AbpPageSearchBoxViewComponent))
                </abp-column>
            </abp-row>
        </div>
    </abp-card-body>
</abp-card>

<abp-card>
    <abp-card-body>
        <abp-table  id="BlogPostsTable" class="nowrap"></abp-table>
    </abp-card-body>
</abp-card>
